// pages/textView/textView.js
Page({
    data: {
      content: '',
      fileName: ''
    },
  
    onLoad(options) {
      this.setData({
        content: decodeURIComponent(options.content || '无内容'),
        fileName: decodeURIComponent(options.fileName || 'unknown.txt')
      });
    },
  
    copyContent() {
      wx.setClipboardData({
        data: this.data.content,
        success: () => wx.showToast({ title: '已复制内容', icon: 'success' }),
        fail: () => wx.showToast({ title: '复制失败', icon: 'none' })
      });
    }
  });